// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

// 获取分页模型列表
export async function getMyPrompts(params: {
  page: number;
  size: number;
  keyword?: string;
}) {
  return request<API.PageResult<API.MyPrompt>>('/prompt/my-prompts', {
    method: 'GET',
    params,
  });
}

// 新增我的提示词
export async function addMyPrompt(data: Partial<API.MyPrompt>) {
  return request('/prompt/my-prompts/new-version', {
    method: 'POST',
    data,
  });
}

// 更新我的提示词
export async function updateMyPrompt(id: string, data: Partial<API.MyPrompt>) {
  return request(`/prompt/my-prompts/${id}`, {
    method: 'PUT',
    data,
  });
}

// 删除我的提示词
export async function deleteMyPrompt(id: string) {
  return request(`/prompt/my-prompts/${id}`, {
    method: 'DELETE',
  });
}
